﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masterpages/Main.master" AutoEventWireup="true"
    CodeFile="AdvisorList.aspx.cs" Inherits="User_Employer_AdvisorList" %>

<%@ Register Src="../../Controls/ContentHolder/Holder1.ascx" TagName="Holder1" TagPrefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    
    <style type="text/css">
        td.locked, th.locked
        {
            position: relative;
            left: expression((this.parentElement.parentElement.parentElement.parentElement.scrollLeft-2)+'px');
        }
    </style>
    <script type="text/javascript">
        //define a function for extracting text from node
        function extractValue(node) {
            var children = node.childNodes[0].childNodes.length
            if (children == 0) //boundTextField or a templateColumn
            {
                if (node.childNodes[0].nodeType == 3)//boundTextField
                {
                    return node.childNodes[0].data;
                }
                else //template column
                {
                    var type = node.childNodes[0].type
                    switch (type) {
                        case "checkbox":
                            return node.childNodes[0].checked.toString()
                        case "radio":
                            return node.childNodes[0].checked.toString()
                        case "text":
                            return node.childNodes[0].value
                        default: return ""
                    }
                }
            }
            else //boundCheckboxColumn or a templateLabelColumn
            {
                if (node.childNodes[0].childNodes[0].nodeType == 3) {
                    return node.childNodes[0].childNodes[0].data;
                }
                else {
                    return node.childNodes[0].childNodes[0].checked.toString();
                }
            }
        }

    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <script language="javascript" type="text/javascript">
        function CallPrint(strid) {
            var prtContent = document.getElementById(strid);
            var WinPrint = window.open('', '', 'letf=0,top=0,width=100%,height=100%,toolbar=0,scrollbars=2,status=0');
            WinPrint.document.write(prtContent.innerHTML);
            WinPrint.document.close();
            WinPrint.focus();
            WinPrint.print();
            WinPrint.close();
            //            prtContent.innerHTML = strOldOne;
        }

        $(document).ready(function () {
            $('[id$=GridViewAdvisors]').tablesorter();
        });
    </script>
    <%--         <uc1:holder1 ID="Holder11" runat="server" Title="لیست مشاوران" >
  <ContentTemplate>--%>
    <div>
        <div id="printdiv">
            <asp:Panel ID="Panel1" runat="server" ScrollBars="Auto" Width="100%" ForeColor="Black"
                Direction="RightToLeft" Height="500px" Font-Names="Tahoma" Font-Size="X-Small">
                <asp:GridView ID="GridViewAdvisors" runat="server" AutoGenerateColumns="False" EnableViewState="true"
                    OnRowDataBound="GridViewAdvisors_RowDataBound" ForeColor="#333333" Font-Names="Tahoma"
                    CssClass="showgrid tablesorter" OnRowCreated="GridViewAdvisors_RowCreated" ShowHeaderWhenEmpty="False"
                    OnDataBound="GridViewAdvisors_DataBound">
                    <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
                    <Columns>
                        <asp:BoundField DataField="Name" HeaderText="نام/نام شرکت" NullDisplayText="---"
                            ItemStyle-Width="200" ItemStyle-Wrap="false"></asp:BoundField>
                        <asp:BoundField DataField="Family" HeaderText="نام خانوادگی / نام مدیر عامل" NullDisplayText="---"
                            ItemStyle-Wrap="false"></asp:BoundField>
                        <asp:BoundField DataField="Address" HeaderText="آدرس" NullDisplayText="---" ItemStyle-Wrap="true">
                        </asp:BoundField>
                        <asp:BoundField DataField="Tel" HeaderText="تلفن ثابت" NullDisplayText="---"></asp:BoundField>
                        <asp:BoundField DataField="Mobile" HeaderText="تلفن همراه" NullDisplayText="---">
                        </asp:BoundField>
                        <asp:BoundField DataField="UserName" HeaderText="نام کاربری" SortExpression="UserName"
                            NullDisplayText="---" Visible="false"></asp:BoundField>
                        <asp:BoundField DataField="Role" HeaderText="عنوان شغلی" SortExpression="Role" NullDisplayText="---"
                            Visible="True"></asp:BoundField>
                        <asp:BoundField HeaderText="kk" NullDisplayText="---" Visible="false"></asp:BoundField>
                        <asp:BoundField HeaderText="شماره ثبت شرکت" SortExpression="CompanyRegistrationCode"
                            NullDisplayText="---"></asp:BoundField>
                        <asp:BoundField HeaderText="تاریخ اعتبار صلاحیت" SortExpression="ValidationDate"
                            NullDisplayText="---"></asp:BoundField>
                        <asp:BoundField HeaderText="پست الکترونیکی" NullDisplayText="---"></asp:BoundField>
                        <asp:BoundField HeaderText="وب سایت" NullDisplayText="---"></asp:BoundField>
                        <asp:BoundField HeaderText="رشته1" NullDisplayText="---" SortExpression="Field1">
                        </asp:BoundField>
                        <asp:BoundField HeaderText="رشته2" SortExpression="Field2" NullDisplayText="---">
                        </asp:BoundField>
                        <asp:BoundField HeaderText="مدرک تحصیلی" SortExpression="Degree" NullDisplayText="---">
                        </asp:BoundField>
                        <asp:BoundField HeaderText="تاریخ فراغت از تحصیل" NullDisplayText="---"></asp:BoundField>
                        <asp:BoundField HeaderText="سابقه کار" SortExpression="SkillYears" NullDisplayText="---">
                        </asp:BoundField>
                        <asp:BoundField HeaderText="استان" NullDisplayText="---" SortExpression="Province">
                        </asp:BoundField>
                        <asp:BoundField DataField="UserId" HeaderText=""></asp:BoundField>
                    </Columns>
                    <EditRowStyle BackColor="#999999" />
                    <FooterStyle BackColor="#5D7B9D" ForeColor="White" Font-Bold="True" />
                    <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" Width="200%"
                        Wrap="false" />
                    <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#CCCCFF" ForeColor="#333333" Width="2000" Wrap="false" />
                    <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
                </asp:GridView>
            </asp:Panel>
        </div>
    </div>
    <%--     </ContentTemplate></uc1:holder1>--%>
    <input id="Button1" type="button" onclick="CallPrint('printdiv')" style="font-family: Tahoma;"
        value="پرینت" />
    <asp:Button ID="ExportToExcel0" runat="server" Text="ذخیره در فایل Excel" Font-Names="Tahoma"
        Height="25px" OnClick="ExportToExcel_Click" Width="150px" />
</asp:Content>
